package shape;

public class Shapes {
    Shape [] shapeList;
    Shapes (Shape[] shapelist) {
        shapeList = shapelist;
    }
    public double getArea() {
        double result = 0;
        for( int i = 0 ; i < shapeList.length ; i++) {
            result += shapeList[i].getArea();
        }
        return result;
    }
    public double getFilledArea() {
        double result = 0;
        for (int i = 0; i < shapeList.length; i++) {
            if (shapeList[i].isFilled()) {
                result += shapeList[i].getArea();
            }
        }
        return result;
    }
    public String toString() {
        String result = "[";
        for (int i = 0; i < shapeList.length; i++) {
            result += shapeList[i].toString();
            if (i < shapeList.length - 1) {
                result += ", ";
            }
        }
        return result + "]";
    }
}
